import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import uView from "uview-ui";
Vue.use(uView);

import './uni.promisify.adaptor'
import store from './store' // 引入 store
// 把vuex定义成全局组件
Vue.prototype.$store = store
Vue.prototype.$showToast = function(message) {
	uni.showToast({
		title: message,
		icon: 'none'
	});
};
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	store, // 注入 store
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
import store from './store'

export function createApp() {
	const app = createSSRApp(App)
	app.use(store) // Vue3 方式注册 store
	return {
		app
	}
}
// #endif